package com.dsjy.yf.address.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dsjy.yf.address.entity.dataobject.TownDO;

import java.util.List;

/**
 * @author whj
 * @version 1.0
 * @date 2021-01-14 15:07
 */
public interface TownService {
    /**
     * @param parentCode
     * @return
     */
    Integer serchMaxTownCode(Integer parentCode);

    /**
     * 获取所有乡镇街道码、乡镇街道名
     *
     * @return
     */
    List<TownDO> searchAll();

    /**
     * 通过区县码获取对应区县下乡镇街道
     *
     * @param parentCode
     * @return
     */
    List<TownDO> searchByCountyCode(Integer parentCode);

    /**
     * 通过乡镇街道码获取对应乡镇街道名
     *
     * @param townCode
     * @return
     */
    String searchByTownCode(Integer townCode);

    /**
     * 增删改
     *
     * @param operate
     * @param townDO
     * @return
     */
    Integer addUpdDel(String operate, TownDO townDO);

    /**
     * 增加乡镇街道
     *
     * @param townDO
     * @return
     */
    Integer addTown(TownDO townDO);


    /**
     * 更新修改
     *
     * @param townDO
     * @return
     */
    Integer updTown(TownDO townDO);

    /**
     * 分页查询
     * @param pageNum
     * @param pageSize
     * @param wrapper
     * @return
     */
    IPage searchWithPage(Integer pageNum, Integer pageSize, QueryWrapper wrapper);
}
